home *** CD-ROM | disk | FTP | other *** search
- # SpecTcl, by S. A. Uhler
- # Copyright (c) 1994-1995 Sun Microsystems, Inc.
- #
- # See the file "license.txt" for information on usage and redistribution
- # of this file, and for a DISCLAIMER OF ALL WARRANTIES.
- #
- # interface generated from edit.ui
- # root is the parent window for this user interface
-
- proc edit_ui {root args} {
-
- # this treats "." as a special case
-
- if {$root == "."} {
- set base ""
- } else {
- set base $root
- }
-
- frame $base.frame#1
-
- scrollbar $base.scrollbar#1 \
- -command "$base.text yview" \
- -orient v
-
- text $base.text \
- -height 20 \
- -width 60 \
- -wrap none \
- -xscrollcommand "$base.scrollbar#2 set" \
- -yscrollcommand "$base.scrollbar#1 set"
- catch {
- $base.text configure \
- -font -*-Courier-Medium-R-Normal--*-140-*-*-*-*-*-*
- }
-
- scrollbar $base.scrollbar#2 \
- -command "$base.text xview" \
- -orient h
-
- button $base.dismiss \
- -command "set Current(dirty) 1;set f(code) \[$base.text get 1.0 end\];destroy $root" \
- -padx 11 \
- -pady 4 \
- -text Dismiss
-
- button $base.apply \
- -command "set Current(dirty) 1; set f(code) \[$base.text get 1.0 end\]" \
- -padx 11 \
- -pady 4 \
- -text Apply
- catch {
- $base.apply configure \
- -font -*-Helvetica-Bold-R-Normal--*-120-*-*-*-*-*-*
- }
-
- button $base.revert \
- -command "append f(code) {}; $root.text delete 1.0 end; $root.text insert 1.0 \$f(code)" \
- -padx 11 \
- -pady 4 \
- -text Revert
-
-
- # Geometry management
-
- blt_table $root $base.frame#1 3,1 \
- -columnspan 2
- blt_table $root $base.scrollbar#1 1,1 \
- -fill y
- blt_table $root $base.text 1,2 \
- -fill both
- blt_table $root $base.scrollbar#2 2,2 \
- -fill x
- blt_table $base.frame#1 $base.dismiss 1,1
- blt_table $base.frame#1 $base.apply 1,2
- blt_table $base.frame#1 $base.revert 1,3
-
- # Resize behavior management
-
- blt_table row $root configure all -resize none
- blt_table row $root configure 1 -resize both
- blt_table row $root configure 1 -height {225 Inf}
- blt_table row $root configure 2 -height {30 Inf}
- blt_table row $root configure 3 -height {30 Inf}
- blt_table column $root configure all -resize none
- blt_table column $root configure 2 -resize both
- blt_table column $root configure 1 -width {30 Inf}
- blt_table column $root configure 2 -width {359 Inf}
-
- blt_table row $base.frame#1 configure all -resize none
- blt_table row $base.frame#1 configure 1 -height {30 Inf}
- blt_table column $base.frame#1 configure all -resize none
- blt_table column $base.frame#1 configure 1 -width {30 Inf}
- blt_table column $base.frame#1 configure 2 -width {30 Inf}
- blt_table column $base.frame#1 configure 3 -width {30 Inf}
- # additional interface code
- global f Clip
- bind $base.text <Control-w> {
- if {$Current(widget) != ""} {
- upvar #0 [winfo name $Current(widget)] data
- %W insert insert $data(item_name)
- }
- }
- bind $base.text <Control-c> {
- set Clip [%W get sel.first sel.last]
- }
- bind $base.text <Control-v> {
- %W insert insert $Clip
- }
- append f(code) {}
- $base.text insert 1.0 $f(code)
- tkwait visibility $root
- focus $base.text
-
-
-
- # end additional interface code
-
- }
-